﻿namespace TestApp.Client
{
    using System.Reactive.Concurrency;
    using Microsoft.Practices.Unity;

    public sealed class ClientUnityContainerExtension: UnityContainerExtension
    {
        protected override void Initialize()
        {
            Container.RegisterInstance<IScheduler>(TaskPoolScheduler.Default);
            Container.RegisterType<IEntitiesViewModel, EntitiesViewModel>(new ContainerControlledLifetimeManager());
            Container.RegisterType<IDataServiceAgent, DataServiceAgent>(new ContainerControlledLifetimeManager());
            Container.RegisterType<IDataEntityViewModel, DataEntityViewModel>(new TransientLifetimeManager());
            Container.RegisterType<IAggregationEntityViewModel, AggregationEntityViewModel>(new TransientLifetimeManager());
            Container.RegisterType<IEntityParamViewModel, EntityParamViewModel>(new TransientLifetimeManager());
        }
    }
}
